<!--
 * @Author: your name
 * @Date: 2022-03-02 09:56:43
 * @LastEditTime: 2022-04-20 18:46:48
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \trace-source-web\src\views\trace-source-manage\components\productionTraceability\components\subject-information.vue
-->
<template>
  <!-- 主体信息 -->
  <el-card id="growingtwo" class="box-card">
    <div slot="header" class="clearfix">
      <span>主体信息 SUBJECT INFORMATION</span>
    </div>
    <el-row>
      <ul>
        <li>
          <span class="zh-lable">| 主体名称:</span>
          <el-input
            disabled
            align="center"
            :value="batchBaseMessageList.organizationName"
          />
        </li>
        <!-- <li>
          <span class="zh-lable">| 主体地址:</span>
          <el-input
            disabled
            align="center"
            :value="batchBaseMessageList.address"
          />
        </li> -->
        <li>
          <span class="zh-lable">| 种养地址:</span>
          <el-input
            disabled
            align="center"
            :value="batchBaseMessageList.plantAddress"
          />
        </li>
        <li>
          <span class="zh-lable">| 负责人:</span>
          <el-input
            disabled
            align="center"
            :value="batchBaseMessageList.contact"
          />
        </li>
        <li>
          <p v-if="zizhiimageList.length > 0" class="batclick">
            <el-button @click="batclick('#X')">点击查看主体资质</el-button>
          </p>
        </li>
      </ul>
    </el-row>
    <el-row v-if="false">
      <!-- 主体荣誉资质 -->
      <div class="honorary">
        <el-button
          class="prev"
          type="text"
          @click="prev()"
        ><i class="el-icon-arrow-left"></i></el-button>
        <div style="width:70%;height:90%;margin-top:45px">
          <el-carousel
            ref="grsfix"
            :loop="true"
            :interval="4000"
            indicator-position="none"
            type="card"
            arrow="never"
            :autoplay="true"
            height="310px"
          >
            <el-carousel-item
              v-for="(item, index) in zizhiimageList"
              :key="index"
            >
              <div>
                <img :src="item.url" class="zhimgl" />
              </div>
            </el-carousel-item>
          </el-carousel>
        </div>
        <el-button
          class="next"
          type="text"
          @click="next()"
        ><i class="el-icon-arrow-right"></i></el-button>
      </div>
    </el-row>
    <!-- 通用图片弹出框 -->
    <el-dialog title="主体荣誉资质" :visible.sync="dialogzizhFormVisible">
      <!-- 检测报告 -->
      <!-- <div class="base-zh-title">主体荣誉资质</div> -->
      <div class="quality">
        <el-button
          class="prev"
          type="text"
          @click="prev()"
        ><i class="el-icon-arrow-left"></i></el-button>
        <el-carousel
          ref="grsfix"
          :loop="true"
          arrow="never"
          :interval="4000"
          type="card"
          :autoplay="true"
          height="420px"
        >
          <el-carousel-item
            v-for="(item, index) in zizhiimageList"
            :key="index"
          >
            <img :src="item.url" class="zhimgl" />
          </el-carousel-item>
        </el-carousel>
        <el-button
          class="next"
          type="text"
          @click="next()"
        ><i class="el-icon-arrow-right"></i></el-button>
      </div>
      <!-- </div> -->
    </el-dialog>
  </el-card>
</template>

<script>
export default {
  props: {
    batchBaseMessageList: {
      type: Object,
      default: () => ({})
    },
    zizhiimageList: {
      type: Array,
      default: () => ([])
    }
  },
  data() {
    return {
      // // 主体荣誉资质图
      // zizhiimageList: [
      //   {
      //     url: require("@/assets/trace-source-manage/zizhiimg/zizhi1.png")
      //   },
      //   {
      //     url: require("@/assets/trace-source-manage/zizhiimg/zizhi2.png")
      //   },
      //   {
      //     url: require("@/assets/trace-source-manage/zizhiimg/zizhi3.jpg")
      //   },
      //   {
      //     url: require("@/assets/trace-source-manage/zizhiimg/zizhi4.jpg")
      //   }
      // ]
      dialogzizhFormVisible: false
    };
  },
  methods: {
    // 跑马灯左右切换
    batclick() {
      this.dialogzizhFormVisible = true
    },
    prev() {
      this.$refs.grsfix.prev();
    },
    next() {
      this.$refs.grsfix.next();
    }
  }
};
</script>

<style lang="scss" scoped>
#growingtwo {
  width: 45%;
  display: inline-block;
  min-height: 216px;
  margin-left: 2%;
  .el-input {
    margin-left: 10px;
    width: 50%;
    ::v-deep .el-input__inner {
      border: 0;
      height: 25px;
      background-color: rgba($color: #0e4352, $alpha: 1);
      border-radius: 40px;
      text-align: center;
    }
  }
  ::v-deep .el-card__body {
    padding: 0;
    .el-row {
      padding: 0px;
      // border-bottom: 1px solid rgba($color: #64b9d1, $alpha: 0.9);
      img {
        margin: 0 auto;
        width: 100%;
        height: 305px;
        // border-radius: 50%;
        box-sizing: content-box;
        border: 2px solid rgba($color: #184e5f, $alpha: 1);
      }
      p {
        margin-left: 20px;
      }
      ul {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        padding: 0;
        padding-top: 20px;
        li {
          display: flex;
          list-style-type: none;
          margin: 0;
          width:50%;
          line-height: 50px;
          justify-content: center;
          .el-input {
            margin-left: 10px;
            width: 60%;
            ::v-deep .el-input__inner {
              border: 0;
              height: 25px;
              background-color: rgba($color: #0e4352, $alpha: 1);
              border-radius: 40px;
              text-align: center;
            }
          }
        }
      }
      .el-col {
        .el-row {
          padding: 10px;
        }
        .left-right {
          border: none;
          border-right: 1px solid rgba($color: #64b9d1, $alpha: 0.9);
        }
        .left-top {
          border-right: 1px solid rgba($color: #64b9d1, $alpha: 0.9);
          //   height: 80px;
          ul {
            padding: 0;
            height: 120px;
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            justify-content: space-evenly;
            align-items: center;
            li {
              background-color: #0f4656;
              list-style-type: none;
              margin: 10px;
              height: 120px;
              width: 90px;
              display: flex;
              flex-direction: column;
              align-items: center;
              justify-content: space-around;
              i {
                font-size: 34px;
              }
            }
          }
        }
      }
    }
    .honorary {
      width: 99%;
      height: 400px;
      margin: 10px 10px auto;
      box-sizing: border-box;
      display: flex;
      justify-content: space-around;
      background: #0f4656;
    }
  }
}
.batclick {
  padding: 0;
  margin: 0;
  width: 84%;
  text-align: end;
  .el-button {
    border-radius: 15px;
    height: 25px;
    line-height: 4px;
    background-color: #007795;
    color: #fffff0;
    border-color: #007795;
  }
  .el-button:hover {
    color: #01fde0;
    border-color: #01fde0;
  }
}
.quality {
  width: 100%;
  height: 100%;
  margin: 10px auto;
  display: flex;
  justify-content: center;
  .el-carousel {
    width: 100%;
    .zhimgl {
      margin-top: 10%;
      width: 100%;
      transform: scale(0.8);
      height: 80%;
    }
    ::v-deep .el-carousel__mask {
      background-color: #00000000;
    }
  }
}
.zh-lable {
  width: 80px;
  white-space: nowrap;
  font-size: 16px;
}
.next {
  i {
    font-size: 100px;
    color: #bcbcbc;
  }
}
.prev {
  i {
    font-size: 100px;
    color: #bcbcbc;
  }
}

.prev:hover,
.next:hover {
  i {
    color: #409eff;
  }
}
// 跑马灯 过渡
::v-deep .el-carousel__item.is-in-stage{
  opacity: 1;
}
::v-deep .el-carousel__item {
  opacity: 0;
  transition: .5s;
}
</style>
